
=============
' This file is generated as part of Web project conversion.
' The extra class 'CompareDirectFriends' in the code behind file in 'send_message.aspx.cs' is moved to this file.
=============


Imports System
Imports System.Collections
Imports System.ComponentModel
Imports System.Data
Imports System.Drawing
Imports System.Web
Imports System.Web.SessionState
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Web.UI.HtmlControls
Imports _2bMatesSite.BO


Namespace _2bMatesSite


    Public Class CompareDirectFriends
        Implements IComparer
        Private sortBy As CompareField = CompareField.Name

        Public Property SortBy() As CompareField
            Get
                Return sortBy
            End Get
            Set(ByVal value As CompareField)
                sortBy = value
            End Set
        End Property


        Public Sub New(ByVal sBy As CompareField)
            sortBy = sBy
        End Sub

        Public Function Compare(ByVal oDF1 As Object, ByVal oDF2 As Object) As Int32
            Dim arrDF1 As ArrayList = DirectCast(oDF1, ArrayList)
            Dim arrDF2 As ArrayList = DirectCast(oDF2, ArrayList)

            Select Case Me.sortBy
                Case CompareField.Name
                    Return [String].Compare(arrDF1(1).ToString(), arrDF2(1).ToString())
                Case CompareField.ID
                    Return Convert.ToInt32(arrDF1(0)) - Convert.ToInt32(arrDF2(0))
                Case Else
                    Return 0
            End Select
        End Function
    End Class

End Namespace






